package com.yingxin.yxerp.module.sys.entity.builder;

import cn.hutool.core.bean.BeanUtil;
import com.yingxin.yx.framework.commons.constant.CommonConst;
import com.yingxin.yx.framework.commons.id.IdHelper;
import com.yingxin.yxerp.module.sys.entity.Salesman;
import com.yingxin.yxerp.module.sys.vo.req.SalesmanCreateVo;
import org.apache.commons.lang3.StringUtils;

public class SalesmanBuilder {

    /**
     * 废料名称 构造器
     */
    public static Salesman build(SalesmanCreateVo createVo) {
        Salesman salesman = new Salesman();
        BeanUtil.copyProperties( createVo, salesman );
        if( StringUtils.isBlank( salesman.getId() ) ){
            salesman.setId( IdHelper.snowflakeId() );
        }
        salesman.setDelFlag( CommonConst.FALSE );
        return salesman;
    }

}
